package com.dmgis.qxfw.dataservice.businessservice.nyfw.controller;

import com.dmgis.qxfw.dataservice.businessservice.nyfw.service.FarmXxfwService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @ClassName FarmXxfwController
 * @Description TODO 信息服务模块
 * @Author sun
 * @Date 2021/7/26 14:49
 * @Version 1.0
 **/
@Controller
@RequestMapping("/nyfw")
public class FarmXxfwController {

    @Resource
    private FarmXxfwService xxfwService;

    /**
     * @Description: 获取站点(农业局获取所有站点 ， 农业大户渲染自己管辖站点)
     * @Author: sunshine
     * @Date: 2021/7/26 14:51
     **/
    @RequestMapping("/getFwStationInfo")
    @ResponseBody
    public Object getFwStationInfo(HttpServletRequest request) {
        String StationID = request.getParameter("StationID");
        String tiaojian = request.getParameter("tiaojian");
        Object agrisrvList = xxfwService.getFwStationInfo(StationID, tiaojian, request);
        return agrisrvList;
    }

    /**
    * @Description: 大户统计
    * @Author: sunshine
    * @Date: 2021/7/26 15:48
    **/
    @RequestMapping("/getDaHuTongji")
    @ResponseBody
    public Object getDaHuTongji(HttpServletRequest request) {
        String strType = request.getParameter("strType");
        Object agrisrvList = xxfwService.getDaHuTongji(strType);
        return agrisrvList;
    }

    /**
    * @Description: 产量预报-得到农作物
    * @Author: sunshine
    * @Date: 2021/7/27 10:29
    **/
    @RequestMapping("/getnyclyb")
    @ResponseBody
    public Object getnyclyb(HttpServletRequest request) {
        String strtybh = request.getParameter("strtybh");
        Object agrisrvList = xxfwService.getnyclyb(strtybh);
        return agrisrvList;
    }

    /**
    * @Description: 产量预报-根据农作物得到作物品种
    * @Author: sunshine
    * @Date: 2021/7/27 10:45
    **/
    @RequestMapping("/getZwTypeByName")
    @ResponseBody
    public Object getZwTypeByName(HttpServletRequest request) {
        String strtybh = request.getParameter("strtybh");
        String cropname = request.getParameter("cropname");
        Object agrisrvList = xxfwService.getZwTypeByName(strtybh,cropname);
        return agrisrvList;
    }

    /**
    * @Description: 得到产量历史/预报
    * @Author: sunshine
    * @Date: 2021/7/27 10:51
    **/
    @RequestMapping("/getChangliangYb")
    @ResponseBody
    public Object getChangliangYb(HttpServletRequest request) {
        String strtybh = request.getParameter("strtybh");
        String cropname = request.getParameter("cropname");
        String year = request.getParameter("year");
        String yearend = request.getParameter("yearend");
        String type = request.getParameter("type");
        Object agrisrvList = xxfwService.getChangliangYb(strtybh,cropname,year,yearend,type);
        return agrisrvList;
    }


    /**
     * @Description: 发育期预报-得到农作物
     * @Author: sunshine
     * @Date: 2021/7/27 10:29
     **/
    @RequestMapping("/getnyfyqyb")
    @ResponseBody
    public Object getnyfyqyb(HttpServletRequest request) {
        String strtybh = request.getParameter("strtybh");
        Object agrisrvList = xxfwService.getnyfyqyb(strtybh);
        return agrisrvList;
    }

    /**
     * @Description: 产量预报-根据农作物得到作物品种
     * @Author: sunshine
     * @Date: 2021/7/27 10:45
     **/
    @RequestMapping("/getFyqZwTypeByName")
    @ResponseBody
    public Object getFyqZwTypeByName(HttpServletRequest request) {
        String strtybh = request.getParameter("strtybh");
        String cropname = request.getParameter("cropname");
        Object agrisrvList = xxfwService.getFyqZwTypeByName(strtybh,cropname);
        return agrisrvList;
    }

    /**
     * @Description: 得到产量历史/预报
     * @Author: sunshine
     * @Date: 2021/7/27 10:51
     **/
    @RequestMapping("/getFayuqiYb")
    @ResponseBody
    public Object getFayuqiYb(HttpServletRequest request) {
        String strtybh = request.getParameter("strtybh");
        String cropname = request.getParameter("cropname");
        String year = request.getParameter("year");
        String yearend = request.getParameter("yearend");
        String type = request.getParameter("type");
        Object agrisrvList = xxfwService.getFayuqiYb(strtybh,cropname,year,yearend,type);
        return agrisrvList;
    }
    
    /**
    * @Description: 农气发布图
    * @Author: sunshine
    * @Date: 2021/7/27 12:52
    **/
    @RequestMapping("/getNyFabutu")
    @ResponseBody
    public Object getNyFabutu(HttpServletRequest request) {
        Object agrisrvList = xxfwService.getNyFabutu();
        return agrisrvList;
    }

    /**
    * @Description: 分布图
    * @Author: sunshine
    * @Date: 2021/7/27 13:02
    **/
    @RequestMapping("/getNyFenBuTu")
    @ResponseBody
    public Object getNyFenBuTu(HttpServletRequest request) {
        Object agrisrvList = xxfwService.getNyFenBuTu();
        return agrisrvList;
    }
}
